package com.eeepay.eeepay_v2.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.eeepay.eeepay_v2.fragment.LimitFragment;
import com.eeepay.eeepay_v2.fragment.OtherInfoFragment;
import com.eeepay.eeepay_v2.fragment.RateFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Ching on 2016/6/30.
 * 进件查询费率、限额、其他限额页面切换Adapter
 */
public class IntoPagerAdapter extends FragmentPagerAdapter {

    private String[] title = new String[]{"服务费率", "服务限额", "基本信息"};
    private List<Fragment> list;
    private RateFragment rateFragment;
    private LimitFragment limitFragment;
    private OtherInfoFragment infoFragment;

    public IntoPagerAdapter(FragmentManager fm) {
        super(fm);
    }

//    public IntoPagerAdapter(FragmentManager fm,String bpId,String merNo) {
//        super(fm);
//        rateFragment = new RateFragment(bpId,merNo);
//        limitFragment = new LimitFragment(bpId,merNo);
//        infoFragment = new OtherInfoFragment(bpId,merNo);
//        list.add(rateFragment);
//        list.add(limitFragment);
//        list.add(infoFragment);
//    }

    public void setList(List<Fragment> list) {
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
